package com.bluestarenergy.provisioning.engine.batch.item.write;

import java.util.List;

import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.factory.annotation.Autowired;

import com.bluestarenergy.provisioning.engine.dao.BudgetBillingDAO;
import com.bluestarenergy.provisioning.engine.domain.CustomerCredit;

public class CustomerItemWriter implements ItemWriter<CustomerCredit>{

	@Autowired
	private BudgetBillingDAO budgetBillingDAO;
	
	public void write(List<? extends CustomerCredit> items) throws Exception {
		for (CustomerCredit customerCredit : items) {
			System.out.println("WRITER == item id :: " + customerCredit.getId() + " Name :: " + customerCredit.getName() );
			budgetBillingDAO.writeCustomer(customerCredit);
			
		}
	}

}
